﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;
using System.Text.RegularExpressions;
using System.Web;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

using System.Linq;

namespace RIS.TMP.WEB.APP.Models
{
    [Table("CFEmployee")]
    public class CFEmployee
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        //[ForeignKey("UserLogin")]
        public int EmId { get; set; }
        public string EmCode { get; set; }
        [Required(ErrorMessage = "กรุณากรอกชื่อ(ไทย)", AllowEmptyStrings = false)]
        public string FirstName_Th { get; set; }
        [Required(ErrorMessage = "กรุณากรอกนามสกุล(ไทย)", AllowEmptyStrings = false)]
        public string FirstName_Eg { get; set; }
        [Required(ErrorMessage = "กรุณากรอกชื่อ(อังกฤษ)", AllowEmptyStrings = false)]
        public string SurName_Th { get; set; }
        [Required(ErrorMessage = "กรุณากรอกนามสกุล(อังกฤษ)", AllowEmptyStrings = false)]
        public string SurName_Eg { get; set; }
        [Display(Name = "Telephone")]
        public string Telephone { get; set; }
        [Required(ErrorMessage = "กรุณาเลือกตำแหน่ง", AllowEmptyStrings = false)]
        [ForeignKey("CDivision")]
        public int DsId { get; set; }
        [Required(ErrorMessage = "กรุณาเลือกเพศ", AllowEmptyStrings = false)]
        public Nullable<int> GenderId { get; set; }
        [Required(ErrorMessage = "กรุณาเลือกสาขา", AllowEmptyStrings = false)]
        [ForeignKey("CFBranch")]
        public int BrId { get; set; }
        [Required(ErrorMessage = "กรุณาเลือกกลุ่มผู้ใช้งาน", AllowEmptyStrings = false)]
        [ForeignKey("CFGroupPM")]
        public int GPMId { get; set; }
        public string Remarks { get; set; }
        public string RecordStatus { get; set; }
        public string CreateBy { get; set; }
        public Nullable<System.DateTime> CreateWhen { get; set; }
        public string UpdateBy { get; set; }
        public Nullable<System.DateTime> UpdateWhen { get; set; }

        public virtual CDivision CDivision { get; set; }
        public virtual CFBranch CFBranch { get; set; }
        public virtual CFGroupPM CFGroupPM { get; set; }

    }
}